package com.herench.bunch.peis.support;

import com.herench.bunch.commons.utils.IdGenerator;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

public class ProxyMsgTemplate  {

    public static Document getOutMsgTpl(String responseXml) throws Exception {
        Document document = DocumentHelper.parseText(responseXml);
        return document;
    }


    public static Document getInMsgTpl(String tradeCode) {
        Document document = DocumentHelper.createDocument();
        Element requestElement = document.addElement("Request");
        requestElement.addElement("TradeCode").addText(tradeCode);
        requestElement.addElement("TerminalCode").addText("YK10102012");
        requestElement.addElement("MachineIP").addText("0.0.0.0");
        requestElement.addElement("TransNO").addText(IdGenerator.getUUID());
        return document;
    }


}
